package com.william.nacoswilliam.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @Describe
 * @Author: william_xhw
 * @Version 1.0
 */

//动态刷新
@RefreshScope
@RestController
@RequestMapping("/config")
public class ConfigController {

//    这是springboot版本的value
//    @NacosValue(value = "${useLocalCache:false}", autoRefreshed = true)
//    private boolean useLocalCache;

    @Value("${useLocalCache}")
    private String useLocalCache;

    @GetMapping("/getUseLocalCache")
    public String get() {
        return useLocalCache;
    }

}
